import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
// const LoginInfoKey = 'loginInfo'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: 7 }) // Cookie过期时间为7天,默认为浏览器级别
}

export function setTokenForWit(token) {
  return Cookies.set(TokenKey, token) // 默认为浏览器级别
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

